Fixed issue with logout from login() function