bug fix for discount calculation --KW