maybe check if `directoriesInPackage ` has at least 1 item before calling `directoriesInPackage[0]` ? Maybe that's safer, idk