use matrix and raw path as safety net