fix chain order