fix issue where total records was not updated