fix headers already sent