add pre_out_query