Solving same issue of #28 for query and queryfile