update loadfunction