Fix bug about throw exception