fix call_user_func for template