Fix updating last record