wrap native function