Used the correct variable in error message. Thanks to Ben for reporting