working on record writing