fixed a bug in the registration