add some except deal code and format some code.