logout on close & empty db