add single thread support