db writing finished