fix fee calculation bug