modified code to use Document instead of DocumentFilter as we need to limit the number of inputs
using Document instead of DocumentFilter
using Document instead of DocumentFilter