Fixing null pointer exception when logging out.