for use in webworkers