update battery check function