Login/Logout functionality sort of working