Fix windows disconnect on close