added native function for call from java