Fixed check undefined session object