added querying threads for relations