Added James' stack patch