completed log in functionality