Fixed the threading model