Fix bug that logs out on switching monitors.