made a few changes to DocumentController