inject index automatically