db delete + write