Improve logout