cleaned up the logout code for iOS, working on logout