added max_amt detection