fix ring overrun