Use correct variable in error message