Add some error handling in