Fixed the bug that localAddr is not set.