fix bug for throw exception