Optimize method for show errors and clean corrupted files