a little exercise showing how to use mongoose middleware