Fix automatic logout.
Check variable existence.