add missing port and socket params before flags