fixed bug on range queries and composite index #2950