catch illegal state exception