Add some additional error handling