fixed chapter 4 bug