Fixing bug in state of charging.