fixed segfault, in-order printout