there is type(name) twice. should it be type(func)