Fixed defect when detection files.