Fixed bug in updateRecord