implemented Rust->JS messaging