add fn at filterUtil & writeDocument