fix infinite loop on mono