Fix a javascript error on the click event.