rewrite the webworker part