made changes to document controller