threading test fails; stack idx needs freeing
fixed stack index free issue