don't need to set port_string to nil here, this pattern is only needed when setting a variable inside a block (which has a different scope from the rest of the function); `if/else` blocks have flat scope.