fixed a reset bug