fixed db destroy bug