fixed bug in registration.