Add filter hook, fixes #3