Fixed problems closing the DB after delete it because token disassociation