add hook for communicating to outer window