fix reading from cached file