RootMotion is enabled in, But mesh still goes outside of Capsule

I have enabled rootmotion in some of my animation assets, created montages using them, but they are still causing the mesh of my character to move outside the capsule. So if the animation ends, the mesh/skeleton snaps back to the player Capsule. Please Help