adding in login logic