Add a bit of error handling