Fix error in registration process