Fixed nil error in the 'Remote side has closed' fix