added middleware to trace view hits