return value from native functions, updated compatibility layer