create index when it is defined