Changes to logout functionality