more slight modifications... leave session should work