fix bug in code example noted by Tom