only start session if headers havent been sent