Add in some error handling.