fix bug when initial port.