add hooks functions