update hook logic to be more specific

fixes #687