work on temporary files and folders, still problems with query file