fix exception in disconnect method