bug fixes on the doc flow