fix cogreg to func