Fix crashes in network sometimes