modified login function, keep track of login status
do not bother logging in if the user does not exist