improving start connection function