Fixed a typo in error handling