fix edge cases where filter is undefined