rewritten logic to check the LOG target and removed blocking UI code