added onQuery event to QueryInterval