add null check for record pointers