fix typo in error throwing

@perfmode typo with the variable name.