Added auto-retry flashing