Change how to handle duplicate user

Add to remove the elements of clients<> during the processing of duplicate user
Added log output