fix broken session management