added locks for client connections