fixed problems with duplicate devices