added stopPropagation function and call it from the close click event and close button click event, this prevents the close button triggering onCloseClick when both 'click' and 'button' are set in closeWith