Added query string handling for the document name.