handle battery charging better