added islogged function