remove warnings and segmentation faults