Move session_write_close to AFTER content