fix erroneous creation/removal of devices if they already exist/do not
exist