Added closing of the pane when clicked outside of it.