major bugfix segmentation