Add error handling on session state switch to handle multiple times through the lock/unlock