add cout = 1000 to query