added missing query construction statement for 'all' type queries