deleted devices - searching fix
deleted devices searching - minor code improvement