Cleanup for network check

Use flag based event instead of trying to interrupte a looping thread (which didn't seem to work)