some fixes to filtering