added twisted conn code