update to sites middleware