failfunc reference error fix