added some checking on registration request