Why are you adding any code?
This works out of the box without anything special; is it broken for you?