Finished adding error handling.