Fixed a wrong variable when logging