fix a bug in document