correct the bug that it's too close to the obstacle after change
direction.