Fix profiling middleware to operate on multisites