fix bounding box calculation for polygon