How to avoid duplicate registrations