formatting changes, fixed middleware crash for admin site