Fixing double disconnect issue