Fixed IllegalStateException.