Thread safety fix for NetworkClient