Restore logout functionality