Added secondary thread support.