defineCurrentSession in fail case can return currentSession = null

propose to check in ALL popUp functions that currentSession is not null and report error it is null