fix mem crash when pending + test > encount