added trigger for hiding menu when clicked outside of element