adding disconnect handler