bug fix pwm