added db setup
moved update souces logic