fix set_function call