Fix tcp mode issue