fixed updateRecord function