sign in into its own function