Changed type of exception thrown to illegalStateException