added support for sending stanzas from multiple threads