Fix record not saved error