Converted nextFunc in engine to new fail check