make the defunptr function