write client login and register