Add title checking as in exercise of chapter 5