Session management fix