use os.path.basename to look for written file