Bug fix for disconnecting port when popup is off