added login check.