added null pattern match