fixed foreach() for line items