fixed bug in modifying more than one device