fixing energy reset bug