Fixed the session id handling