You're iterating over impressions which means that your doing per impression filtering yet in the filter function you're narrowing the creative set of ALL impressions. This leads me to think that the filter will not work as advertised. For the moment, I recommend that you use the newly added IterativeCreativeFilter (https://github.com/datacratic/rtbkit/blob/master/rtbkit/core/router/filters/generic_creative_filters.h#L70) so that you don't have to worry about all the annoying details of writing filters.