Use exception to handle the error