Changed the logout mechanism a little bit