complete login functions