rewrite check-online & check-debug logic