fix IllegalStateException