bugfix in events
added save on click outside