fix error in exercise 40