fixed connect functionality