Closes modal when clicking outside of it