Minor updates to uploadDocument() method