Update error handling with typo fix