Added multiple document support