fix escape predicate function