update port config to check env variable