Enhacements in connections

Enhacements in connections. Thanks to Ahmed.