added jni support