made lib web worker friendly