adding method to reset gradient