I suggest u make it so that it waits for them to spawn a little while longer before he starts to walk away and regain agro. Usually the crabs take a little bit longer to spawn so it thinks it has to start walking to regain agro. The gap is only like 20sec max. GOod bot otherwise.