add file with query at end