fix unit test headers already sent error