fix auto generic wrap for functions