Check for folders before deleting