fix a bug in connections_manager