tried to fix session already sent errors