added event delegation for click events