Debugged the registration problem