Revised DB destruct function