adding nested chapters support