update source when switching to source view.