added null check