added isNull() check