added null checks to the predicates