fixed login and register bug