rejig the hooks Closes #2263.