changed socket-port to two procedures