perform logout before login to fix the 'already authenticate' issue