prevent stack size explosion from autoTrim

fix #16
0.12.3