using mutex for all connections