added functionality so you can't register the same device twice