Why would prevd ever not be set here? Use block form of cd:

```
cd ".." do
end
```