bug fixed for add document