added support for query historic task instances