Added double click to exit function