fix destroy db bug