add flatten option to ccbpublish