add null check to record