fix a bug in move ordering