need to check whether user is logged in.