fix bug in document