changed conditional determining if user is logged in