added db-loader function