Fixed the bug of invalid amount.