proper UI exit handling