fix allContracts query