Concurrency fix, support for multiple connections