modified to ignore .metadata folder