Add and export the change_source function