Add check for session ID before trying to call logOut