advanced example in docs corrected