finish login and register