fixed bugs related to filtering