bugfix: legnth was not set when passing binary buffer fiedls to Lua
track app event state only when needed, i.e. when a filter is requesting it