fixed a bug in datastore db overwrite function