bug fix for wrong calculation of the bounding box