fixed charge and discharge method of ModCompatIC2
surrounded with try bracket to avoid error.