fix: Integer Overflow causing infinite loop