fix offline charging and problem regarding flashing