How about renaming the second parameter to curDoc?