fixed bug so that last document in sales data gets added to DB