add sanity check in registration