Headers already sent error fixed