Fixed bug with click outside the container toggling it instead of closing