infinite loop in Binary case