function setHandler