updated to handle `.` and `..` directory locations correctly