fixed duplicated headers and CSV links from multiple queries