Re-ordered middleware calls - old configuration was incorrect