fixed bounding box handling