avoid using two connections at the same time