fix updateRecord method, add test