only log out if necessary
Merge branch '1.12'