Changed variable name

Changed $dir to $dirObj to note it's an object