logout only if logged in.