homepage login function implementation