discount calculation fix