fix visualizer closing (program carries on but visualizer still does not close)