Problem seems to be with first line <? ?>. Adding encoding seemed to save it but then bug appears seemeingly randomly