fix longest block detection edge case