bug fixing in indexscan