Prevent Character from Falling off Edge when more than Half Off (2D)

I have my character controller pretty much ready, except there is one flaw: When he gets half off of an edge, gravity takes over and he is pushed down. He flips and flips. With the built in character controller, he stays on the edge until his entire character has fallen off. Both my ground and my character are box colliders. Thanks!

I think You have already found an answer to this but might someone see this question and want an answer

so u need to freeze the rotation form the rigidbody2d