bugfix in quit_session