Encapsulation of polymers into MoS2 and metal to insulator transition in metastable MoS2