fixed remaining balance bug