added check for duplicate registration