fix some bugs: forget to decrement size