test presence of path before deleting it