IF query type is union, results do not get returned