fix for FILE in if loop