fix crash when disconnecting a folder