logout and flag delete