More work to fix empty screen bug in some situations. Now should logout and redirect to login. Also rearrange login screen a bit.