fix the bug of the retreat function