Avoid registering the same callback twice