fixed: supports multi-threaded