set the database to null after cose