fix code error in chapter 11, close #45