Merge pull request #5947 from nabinhait/patch_order_fix

Changed the order of the patch