Fix error when battery is not pluged in the computer