updated jni with more stability