subscribe to query event