Updated controller to resolve the user registration issue.