Made AVR realtime handling more robust