fix bug segmentation fault when the esl becomes to small