bonding: fix loop boundary condition