Added db input/output into files