fixed apc function