fix logout proccedure