Made saveAs function a worker function

For performance