function_wrapper, to be tested