Fixed uncaught ECONNRESET error when disconnectiong