Fix header already sent