update source function