removed excessive code in login and register