added bootloader error check