added leave confirmation dialog