Fix undefined property 'remoteAddress'

Sometimes `Error: TypeError: Cannot read property 'remoteAddress' of undefined` occurs, try to fix it.