create login function on home page