fix script when rhq_agent_debug is on