Made a function to call the clear properly in the callback