finish basic function and login