use IO instead of open to read query files