avoid stack overflow when doing filter in eager mode