fix the MAD module to use user-defined MAD discount percent