moves open pop up to click event, so pop up message appears in browsers