fix database creation/deletion