fix for TopPipe with duplicate values