Packethook fix

This pull request fixes and improves the injection of the packethook