apphook firing only if apphook present
Merge pull request #2937 from digi604/fix-2911

apphook firing only if apphook present