Fixed bugs on User login and Registration