adding middleware as part of SAAS-2006