Fixes "headers already sent" error.