Finally some error handling.