fixed logout not working properly