added disconnect functionality