Another attempt to fix a potential problem with the events query.