update document function. fill final for version 2