Corrects seg fault that occurs after end segmentation and a click in view 3d