support the usage when inside a webworker