fixing cookbook code. Closes #531
Merge pull request #533 from caelum/fixingCookbookCode

fixing cookbook code. Closes #531