Sample crash fix