modify readFile method