Fixed a weird merge conflict and fixed event handling for click