Fix issue where click event would fire on page load