fixing connect functionality