added debugging, update pwm on lock or release