re-built and checked v2.5 with balance function update