fixed IllegalStateException