removing invalid files