fixing cursor and resultset index difference