fixed code in js worker (no jquery allowed there)