modified the way ip and port are set