now checks index hash before inserting index