change to flatten to remove the directory at the end