Fix database deletion issue, add deletion for other database