added functionality for logging in