fix registration error return value