fixed bug of unreset/closed stmt