Fix missing `new` statement  in cookbook examples