fix incorrect return value of index comparison