Added javascript code to track worker behaviour.