Fix methodhandler example

This is a possible fix  for the methodhandler example.

I am not sure if this is the correct, idiomatic way to re-write the example, but it does work.