don't try to read beyond end of file