added auto refresh and conditional logging