fixed bug in db delete