Rewritten class RegisterController, UserController and fixed defect