Adding filter function.