Remove write_to_query_file