fix bug when providing an array as order