added case of empty selectedSources