finished all calculation setting to db except for directory