rename result to type in messages from worker scripts