Fix: Correctly find the file name within the directory string.