Changed way of detecting index or view