cleaned up the session lookup