Bugfix: setting new session after checking old session.