Ending ui and session