Fix bug: the order cannot be reversed because of the side effect of the operator[] in map