worked on upgrade_detector.cs