Fixed bug of logging out