slightly amemded logging