Updating to use global postmessage