Add an `oldPath` variable and fix a syntax error