fix matlab crash on SPIS