added battery_exists conditional, to check if battery exists