Fix delete of db before saving