add size filtering before loop