avr: improved pb state handling