doc factory for inserting and fix call in dao