fix deleting/stopping device issue