Added the remove event listener. I changed it from the variable that I had to removeeventlistener method.