Fixed typo in error handling