added downloadInvoice()