fix typo in error handling