Rapair a random illegalstatexception