Fix nil issue on filter

@knutsenm Please review