initialized login function