fix cmp on index