fix readFile method