fix bug in the registration