Fixed the login in and check to see if logged in function.