Introduced updateRefIndex whenever records are updated