segmentation segfaults when using bounding box