Bugfix with HTML event handling