login and register functionality modified