log in function, modified routing