better preferences and logout