fix samples/battery.js