Make sure that agent_onload and agent_onunload are processed only once.