add index and range to rules