Deleting bad files and creating new entities