protect the registration close and only close if we have a registration.