fixed a bug about reset
Fixed #19