fix error on uploading document