add functionality to retain sources from the database by their ID