issue #672 improvements in a hook