fixed a bug in the embedded rscript