Used the wrong variable in the directory logic.