fixed generate index