Fix bad used variable to log message