fixing reset bug