fix minor error for record and remove unnecessary code