front end for add doc