Implemented check for adding with same id.