Checks for whether the battery is charging
Added a check for whether the battery is charging