Add sethook method