migrate detect_wm