‘dir’ is too broad — using wdir instead.