now detecting if code is in a worker - close #862