Fix for sorting and filtering