added middleware example