Fix sorting while filtering

fixes #172