fix the bug of not checking amount