logging the wrong variable