Close modal on escape and click outside modal