Removing invalid files