added middleware example hook