fix filter undefined offset issue