Added new function to handle adding sources