Added code for battery checker