fix generate index