fixed up replace fun calls