insert document improved