db writing and reading done