fixes the off-by-one error in buffer offset counter