bug fix to new session code