fixing scoping issue for index sync

Fixes #106 .