Fixed middlevare 'stackSize' bug