only use the js hook when needed