fix a bug in check order