Deleted redundant code that's causing problem in web worker