fixed typo in error handling