Fixing the huge lag spikes, caused by threading.