fix get invoices bug