Only create filter if necessary