fixed sorting and filtering