major bug fix in session id generation