fix the bug of agent effecting