1.finish user login and register function