fix heatbugs and make resettable