added preventing of duplicate registration