Fixed an issue that history order is incorrect