add index when commmit