#140 login function complete