Fix threading model