Added in checking only when device is charging. Not tested yet.