fix unsafe tests crashes