fix amountLeft not properly set.