change pre_out_query