Added conditions for thread-based networking