Persistence and logout fixed