better js click handling