Fix bug in session assignment