fixing bugs regarding script tags and comments