Fixed bug with connection creation