added disconnect functionality
fixed merge