ignoring undefined and null for boolean validation