Added leaving feature