successfully created a login function