Fixed typo causing errors not to be handled