fix event query support when using JavaScript API