initial login function.