Use path.basename instead of manually splitting out the file name