Made some changes to logging