- added checks around session state