moved click handler to dom