rework login and register