Fix multiple reset bug