added missing null check