correct web worker function wrapping