fix buildIndexes.js