modify port and dir