auto-resize bug fixed, close #44