error in finding indexes