Fixed an error in registration