fix some bug about amount_remain