How to handle battery charging power failure