fix minAmount not define bug