return ptr from native method