fixed bug in addRecord