skeleton function for login