added null check.