fixed logout and restrict