fixing record reading