Fix bug in connections