check for existence of key first for events_query