fixed an issue with the click handler