added null guard