fix a null ref bug in filter