fix bug on filter and sort