attempt to fix the multi-middleware call bug