fix for "java.lang.IllegalStateException: self instance has changed" bug

fix for "java.lang.IllegalStateException: self instance has changed" bug