hide cursor when leaving main loop