moved click event to document.ready