corrected path.basename() usage