added behavior to logout on page exit