added sort
added consume_record sort