fix unsussessful login and register bug