Replace insertBefore with appendChild to insert css in head