fixed broken middleware contracts