fixed bug in bounding box wrapping