Added an extra null check for BoundingBox