Fix bug of mode agent.