Seems that $0 is like 'sh'? shouldn't it be the path to the '.js' file? preferably some absolute version of the path to the js file?