closing all database instances