fixed delete bug in DB