bug fix to remove the dropdown after click elsewhere in the dom