add null check to t here