fix loadFunction