fix silly underflow bug