make sure the query is generated on event call