Wait for agent to start