BUG: fix bug displaying results in incorrect order