Fixed bug in record update